import 'package:equatable/equatable.dart';

part 'errors.dart';

abstract class ValidateCustomCollectionTitle {
  CustomCollectionTitleValidationError? call({
    required String customCollectionTitle,
  });
}

class ValidateCustomCollectionTitleImpl implements ValidateCustomCollectionTitle {
  const ValidateCustomCollectionTitleImpl();

  @override
  CustomCollectionTitleValidationError? call({
    required String customCollectionTitle,
  }) {
    if (customCollectionTitle.isEmpty) {
      return const EmptyCustomCollectionTitleValidationError();
    }

    return null;
  }
}
